class Solution {
public:
    const int even = 0x55555555;
    const int odd = 0xaaaaaaaa;
    int exchangeBits(int num) {
        //用10101提取偶数位，用010101提取奇数位
        return ((num & even) << 1) | ((num & odd) >> 1);

    }
};